#include <stdio.h>

#define TRUE (1==1)
#define INITIAL_VALUE (1)

#define OPTION_ENTER (1)
#define OPTION_DISPLAY (2)
#define OPTION_EXIT (3)


int main(int argc, const char ** argv)
{
	int option = 0;
	int count = 0;
	long value = INITIAL_VALUE, tmp = 0;

	while (TRUE) {
		/* 
		 * display menu 
		 */
		printf("So far you have entered %d numbers\n", count);
		printf("(%d) Enter another number\n", OPTION_ENTER);
		printf("(%d) Display multiplication\n", OPTION_DISPLAY);
		printf("(%d) Exit\n", OPTION_EXIT);
		printf("Select an option: ");

		/* 
		 * get user input 
		 */
		scanf("%d", &option);

		/*
		 * handle selected option (invalid options are ignored)
		 */
		if (option == OPTION_DISPLAY) {
			printf("The current multiplication is %ld\n", value);
		}
		else if (option == OPTION_ENTER) {
			printf("Enter number: ");
			scanf("%ld", &tmp);
			value *= tmp;
			count += 1;
		}
		else if (option == OPTION_EXIT) {
			printf("Goodbye\n");
			break;
		}
		printf("\n");
	}

	/*
	 * great success
	 */
	return 0;
}